/**********************************************
Table D3: Placebo and Time-Varying Observables
Author: Raluca L. Pahontu
***********************************************/

qui{
preserve
gen nuclear_bi = 1 if p18 == 1 
replace nuclear_bi = 0 if p18 == 2 | p18 == 3

gen trade_union  = . 
	replace trade_union = 1 if n42 == 1 | n42 == 2
	replace trade_union = 0 if n42 == 3
	
gen public_sector = .
	replace public_sector = 1 if  w32 ==2
	replace public = 0 if w32 ==1

xtset idpers year
}
*Column 1
qui xtreg nuclear_bi i.rho  $cfe $csim $crest , fe cl(idpers)
estimate store tabled3column1
outreg2 using "tabd3.doc", replace  keep(2.rho 3.rho) dec(2)

*Column 2
qui xtreg spending_demand i.rho  $cfe $csim $crest public_sector, fe cl(idpers)
estimate store tabled3column2
outreg2 using "tabd3.doc", append keep(2.rho 3.rho public_sector)  dec(2)

*Column 3
qui xtreg spending_demand i.rho  $cfe $csim $crest left, fe cl(idpers)
estimate store tabled3column3
outreg2 using "tabd3.doc", append  keep(2.rho 3.rho left)  dec(2)

*Column 4
qui xtreg spending_demand i.rho  $cfe $csim $crest trade_union, fe cl(idpers)
estimate store tabled3column4
outreg2 using "tabd3.doc", append keep(2.rho 3.rho trade_union) dec(2)

*Column 5

qui xtreg spending_demand i.rho i.canton##c.year i.year $csim $crest, fe cluster(idpers) 
estimate store tabled3column5
outreg2 using "tabd3.doc",  append keep(2.rho 3.rho)  dec(2) 

*Column 6
qui xtreg spending_demand i.rho  $cfe $csim $crest  if age>25, fe cl(idpers)	
estimate store tabled3column6
outreg2 using "tabd3.doc", dec(2)   keep(2.rho 3.rho) append tex
	
esttab tabled3column* , b(a1) se star(* 0.10 ** 0.05 *** 0.01) keep(2.rho 3.rho) /// 
coeflabels(2.rho  "Risk Rho2 " 3.rho "Risk Rho1") 
restore
